
package panelframe;

import java.awt.Color;
import java.awt.Graphics;
import javax.swing.JFrame;


public class Frame extends javax.swing.JFrame {

    Panel areaDibujo = new Panel();
    
    public Frame() {
        initComponents();
        this.setTitle("Dibujo de Poligonos");
        this.setIconImage(null);
        
        this.setSize(800,500);
       areaDibujo.setBounds(50, 100, this.getBounds().width-100, this.getBounds().height-100);
        areaDibujo.setBackground(Color.white);
        this.add(areaDibujo);
        
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    public void paint(Graphics g){
        super.paintComponents(g);
        
        areaDibujo.setSize(this.getBounds().width-100, this.getBounds().height-150);
        
        
        
        
        
    }
    
    
    
    
    
    
    
    public static void main(String args[]) {
        /*
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new frame().setVisible(true);
            }
        });
        * 
        * **/
        Frame v = new Frame();
         v.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      // v.setSize(800,800);
         
       //  Panel lienzo = new Panel();
         //lienzo.setBackground(Color.white);
         //lienzo.setBounds(100, 100, 400, 400);
         //v.add(lienzo);
         
         
         
         
           v.setVisible(true);
         
        
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
}
